<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;


use App\Http\Controllers\UserController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});



Route::group(['prefix'=>'users','middleware' => ['token']], function () {

    Route::controller(UserController::class)->group(function () {

        Route::post('/login', 'login')->withoutMiddleware('token');
        Route::post('/getUserData', 'getUserData');
        Route::post('/getOrganization', 'getOrganization');
        Route::post('/getTaskFolder', 'getTaskFolder');
        
    });

});